import { RouteRecordRaw } from 'vue-router'

const pageTitle = (name: string): string => {
    return `pagesTitle.${name}`
}

/*
 * 静态路由
 */
const staticRoutes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'home',
        component: () => import('../views/HomeView.vue'),
      },
]


const routeAt = (key: string = '/'): Array<RouteRecordRaw> => {
    // const results = staticRoutes.map((route: RouteRecordRaw) => { return route.path == key })
    const route = staticRoutes.find(e => e.path == key);
    return route ? [route] : []
}


export { staticRoutes, routeAt }
